Skip to content

test(macos): guard source-free node:http release links - #9770

Closed
proggeramlug wants to merge 2 commits into
mainfrom
fix/8907-macos-http-link
Closed

test(macos): guard source-free node:http release links#9770
proggeramlug wants to merge 2 commits into
mainfrom
fix/8907-macos-http-link

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The v0.5.1220 macOS arm64 release fails to link the minimal node:http server with 17 undefined HTTP symbols, while the HTTP-free control works. Current main already contains the fix discussed in #5983; this PR adds native link and lifecycle coverage for the released-installation path.

The regression stages the compiler and coherent full runtime/stdlib/HTTP archives outside the source checkout. It compiles an HTTP-free control and a server in both default and PERRY_NO_AUTO_OPTIMIZE=1 modes, checks that default mode actually takes the source-free fallback, and requires the server to listen on an ephemeral port, close, and exit with Node's expected output. A 30-second runtime bound catches hangs. The suite runs on macOS and Linux, and the TypeScript fixture is also picked up by compile-smoke.

Validation on macOS arm64:

  • Reproduced all 17 undefined symbols with the installed v0.5.1220, in both modes; the HTTP-free control prints ok.
  • Built current main and matching archives from this isolated worktree with cargo build --profile perry-dev -p perry -p perry-runtime-static -p perry-stdlib-static -p perry-ext-http.
  • Both modes compile and run the staged source-free server successfully, printing listening and closed, matching Node 26.5.1.
  • All 62 local script/format lint gates passed (SKIP_COMPILE_GATES=1 BASE_SHA=origin/main scripts/run_lint_gates.sh; the broad compile tier and two CI-only checks were skipped).
  • Both Rust regression suites passed (2 tests; the new test covers four compile/run cases): PERRY_RUNTIME_DIR="$PWD/target/perry-dev" cargo test -Z panic-abort-tests --profile perry-dev -p perry --test issue_8907_macos_http_link --test issue_8587_prebuilt_stdlib_http_isolation -- --nocapture. The nightly test option preserves the shipped panic=abort profile.

No version bump.

Closes #8907.

Summary by CodeRabbit

  • Bug Fixes
    • Added regression coverage for HTTP applications built from source-free installations on macOS and Linux.
    • Verified server startup, listening, shutdown, and successful process completion in standard and no-auto-optimization modes.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: f6a1aa81-4e4b-49d1-91c5-2f0f3c5efee3

📥 Commits

Reviewing files that changed from the base of the PR and between 12efed1 and 1e7c2c8.

📒 Files selected for processing (3)
  • changelog.d/9770-macos-http-link.md
  • crates/perry/tests/issue_8907_macos_http_link.rs
  • test-files/test_issue_8907_http_link.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Adds a Unix regression test for source-free node:http linking. The test stages or builds required archives, compiles fixtures in two optimization modes, and verifies successful HTTP server execution.

Changes

HTTP linking regression

Layer / File(s) Summary
HTTP fixture and regression definition
test-files/test_issue_8907_http_link.ts, crates/perry/tests/issue_8907_macos_http_link.rs, changelog.d/9770-macos-http-link.md
Adds an HTTP server lifecycle fixture and documents coverage for default and PERRY_NO_AUTO_OPTIMIZE=1 modes.
Archive discovery and compilation
crates/perry/tests/issue_8907_macos_http_link.rs
Discovers a complete PERRY_RUNTIME_DIR bundle or builds the runtime, standard library, and HTTP archives together. Compiles HTTP and non-HTTP fixtures with workspace discovery disabled.
Timed runtime validation
crates/perry/tests/issue_8907_macos_http_link.rs
Runs each compiled fixture with captured output and a 30-second timeout. Checks successful exit status, fallback behavior, and server closure output.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 1e7c2

This change adds source-free node:http regression coverage across both optimization modes and verifies a server can listen, close, and exit cleanly. No current merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the macOS source-free node:http release-link regression coverage.
Description check ✅ Passed The description provides the change summary, implementation details, related issue, test plan, validation results, and version-bump status. It does not use the template headings or include the checkli…
Linked Issues check ✅ Passed The regression tests address issue #8907 by covering source-free node:http linking on macOS and Linux, both optimization modes, an HTTP-free control, required archive availability, and successful HTTP…
Out of Scope Changes check ✅ Passed The changelog entry, regression test, and HTTP fixture are directly related to the linked issue and stated regression-coverage objectives. No unrelated code changes are identified.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/8907-macos-http-link

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main via merge train #9804 (rebase-merged, so your commits keep their authorship). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS arm64 0.5.1220: any program importing node:http fails to link — 17 undefined _js_*http* symbols from libperry_stdlib.a

1 participant